package com.city.repository.pub;

import com.city.domain.pub.PubSystem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @deprecation: 子系统接口
 * @email: leichuqiao@126.com
 * @author: 雷楚桥
 * @date: 2018/7/22 11:17
 */
public interface PubSystemRepository extends JpaRepository<PubSystem,Integer> {


    /**
     * @deprecation 根据上级目录查询所有的目录
     * @params parent Integer 查询parent的值
     * @return List<PubSystem>
     * @author 雷楚桥
     * @date 2018/7/22 11:24
     */
    @Query(value =  "SELECT  * FROM pub_system " +
                    "WHERE parent = ?1"
                    ,nativeQuery = true)
    List<PubSystem> findAllSystemByParent(Integer parent);
}
